package com.doget.data.delete;

import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
import android.content.IntentFilter;
import android.os.Bundle;
import android.os.Debug;
import android.util.Log;
import android.view.View;
//import android.view.animation.AccelerateInterpolator;
//import android.view.animation.LinearInterpolator;
//import android.widget.LinearLayout;
//import android.widget.RadioButton;
//import android.widget.RelativeLayout;
//import android.widget.TextView;
//
//import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

import com.doget.comment.utils.AESUtils;
import com.doget.data.R;

public class DeleteActivity extends AppCompatActivity {
    private String pwd = "dong";
    private int i = 99999999;
    private String miam = "nimen";

    @Override
    protected void onDestroy() {
        Debug.stopMethodTracing();
        super.onDestroy();
    }

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_delete);
        Debug.startMethodTracing();

        //蓝牙搜索
        BlueToothFoundReceiver blueToothFoundReceiver = new BlueToothFoundReceiver();
        IntentFilter filter_found = new IntentFilter(BluetoothDevice.ACTION_FOUND);
        filter_found.addAction(BluetoothAdapter.ACTION_DISCOVERY_STARTED);
        filter_found.addAction(BluetoothAdapter.ACTION_DISCOVERY_FINISHED);
        registerReceiver(blueToothFoundReceiver, filter_found);

        findViewById(R.id.tag1).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                int mes = i++;
                miam = AESUtils.encrypt("" + mes, pwd);
                Log.i("AESUtils====加密", mes + "====onClick: ==" + miam);
            }
        });

        findViewById(R.id.tag2).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                String aa = AESUtils.decrypt(miam, pwd);
                Log.i("AESUtils====解密", "====onClick: ==" + aa);
            }
        });
    }

// <uses-permission android:name="android.permission.BLUETOOTH" />
//    <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
//    @Override
//    public String[] getPermission() {
//        return new String[]{Manifest.permission.ACCESS_FINE_LOCATION,Manifest.permission.ACCESS_COARSE_LOCATION,
//                Manifest.permission.BLUETOOTH,Manifest.permission.BLUETOOTH_ADMIN,Manifest.permission.BLUETOOTH_PRIVILEGED
//         };
//    }

//    @Override
//    public void onPermissionRequestSuccess() {
//
//    }
//
//    @Override
//    protected void onResume() {
//        super.onResume();
//        requestPermission();
//    }
//
//    @Override
//    public void onPermissionRequestFail() {
//
//        showMissingPermissionDialog("缺失权限！");
//
//
//    }
}
